package com.huirui.server.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品列表信息VO
 * 用于返回商品列表页所需的核心信息
 */
@Data
@Schema(description = "商品列表信息VO")
public class ProductListInfoVo {

    @Schema(description = "商品ID", example = "10001", type = "integer", format = "int64")
    private Long productId;

    @Schema(description = "商品名称", example = "华为Mate 60 Pro", maxLength = 200)
    private String productName;

    @Schema(description = "商品主图URL", example = "https://example.com/images/product/10001.jpg", maxLength = 500)
    private String productImage;

    @Schema(description = "最低售价", example = "5999.00", type = "number", format = "decimal", minimum = "0.01")
    private BigDecimal minPrice;

    @Schema(description = "最高售价", example = "7999.00", type = "number", format = "decimal", minimum = "0.01")
    private BigDecimal maxPrice;

    @Schema(description = "累计销量", example = "12580", type = "number", format = "decimal", minimum = "0")
    private BigDecimal saleCount;

    @Schema(description = "库存数量", example = "3680", type = "integer", format = "int64", minimum = "0")
    private Long stock;

    @Schema(description = "商品状态,0-上架中，1-下架中，2-已售罄", example = "1", allowableValues = {"0", "1", "2"})
    private Integer productStatus;

    @Schema(description = "商品类型 0-普通商品，1-秒杀商品，2-临期特惠商品，3-新客专享商品", example = "3", allowableValues = {"1", "2", "3", "4"})
    private Integer productType;

    @Schema(description = "商品权重", example = "226", type = "integer", format = "int64", minimum = "0")
    private Long weight;

    @Schema(description = "创建时间", example = "2025-01-15T08:30:45", type = "string", format = "date-time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "更新时间", example = "2025-01-20T14:22:36", type = "string", format = "date-time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
}
